package com.hirain.templatemethod;

/**
 * Created by caicf on 2016/8/23.
 */
public class ConcreteClass extends AbstractClass {
    @Override
    protected String primitiveOperation1() {
        return "operation1";
    }

    @Override
    protected String primitiveOperation2() {
        return "operation2";
    }

    @Override
    boolean hook() {
        String status=getConditionFromRemote();
        if (status.equals("done")){
            return true;
        }
        return false;
    }

    String getConditionFromRemote(){
        //一系列业务操作
        return "done";
    }
}
